/**
 * jims
 */
package com.jims.master.modules.blood.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jims.master.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 血液入库明细记录Entity
 *
 * @author fengyg
 * @version 2017-04-07
 */
public class BloodInpDetail extends DataEntity<BloodInpDetail> {

    private static final long serialVersionUID = 1L;
    private String inpMasterId;        // 主表id
    private String bloodId;        // 血袋号
    private String patBloodGroup;        // 血型
    private String rh;        // RH
    private String componentId;        // 血液成份代码
    private String bloodCapacity;        // 储血量
    private Date invalDate;        // 有效日期
    private String bloodDonorName;        // 献血者
    private String flag;        // 库存状态（1 已出库，0 未出库，未出库则可修改）
    private Date bloodGatherDate;        // 采血日期
    private String units;        // 单位

    private BloodInpMaster bloodInpMaster;   //血液入库主记录
    private String bloodComponentName;    //血液成分名称
    private String unitsName;    //单位名称
    private String patBloodGroupCode; //血型代码
    private String rhCode;   //rh代码
    private String inpNo;
    private Date startDate;
    private Date stopDate;

    List<BloodInpDetail> detailList;

    public BloodInpDetail() {
        super();
    }

    public BloodInpDetail(String id) {
        super(id);
    }

    @Length(min = 0, max = 64, message = "主表id长度必须介于 0 和 64 之间")
    public String getInpMasterId() {
        return inpMasterId;
    }

    public void setInpMasterId(String inpMasterId) {
        this.inpMasterId = inpMasterId;
    }

    @Length(min = 1, max = 100, message = "血袋号长度必须介于 1 和 100 之间")
    public String getBloodId() {
        return bloodId;
    }

    public void setBloodId(String bloodId) {
        this.bloodId = bloodId;
    }

    @Length(min = 1, max = 2, message = "血型长度必须介于 1 和 2 之间")
    public String getPatBloodGroup() {
        return patBloodGroup;
    }

    public void setPatBloodGroup(String patBloodGroup) {
        this.patBloodGroup = patBloodGroup;
    }

    @Length(min = 1, max = 2, message = "RH长度必须介于 1 和 2 之间")
    public String getRh() {
        return rh;
    }

    public void setRh(String rh) {
        this.rh = rh;
    }

    @Length(min = 1, max = 64, message = "血液成份代码长度必须介于 1 和 64 之间")
    public String getComponentId() {
        return componentId;
    }

    public void setComponentId(String componentId) {
        this.componentId = componentId;
    }

    public String getBloodCapacity() {
        return bloodCapacity;
    }

    public void setBloodCapacity(String bloodCapacity) {
        this.bloodCapacity = bloodCapacity;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "有效日期不能为空")
    public Date getInvalDate() {
        return invalDate;
    }

    public void setInvalDate(Date invalDate) {
        this.invalDate = invalDate;
    }

    @Length(min = 0, max = 20, message = "献血者长度必须介于 0 和 20 之间")
    public String getBloodDonorName() {
        return bloodDonorName;
    }

    public void setBloodDonorName(String bloodDonorName) {
        this.bloodDonorName = bloodDonorName;
    }

    @Length(min = 1, max = 1, message = "库存状态（1 已出库，0 未出库，未出库则可修改）长度必须介于 1 和 1 之间")
    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getBloodGatherDate() {
        return bloodGatherDate;
    }

    public void setBloodGatherDate(Date bloodGatherDate) {
        this.bloodGatherDate = bloodGatherDate;
    }

    @Length(min = 0, max = 10, message = "单位长度必须介于 0 和 10 之间")
    public String getUnits() {
        return units;
    }

    public void setUnits(String units) {
        this.units = units;
    }

    public BloodInpMaster getBloodInpMaster() {
        return bloodInpMaster;
    }

    public void setBloodInpMaster(BloodInpMaster bloodInpMaster) {
        this.bloodInpMaster = bloodInpMaster;
    }

    public String getBloodComponentName() {
        return bloodComponentName;
    }

    public void setBloodComponentName(String bloodComponentName) {
        this.bloodComponentName = bloodComponentName;
    }

    public String getUnitsName() {
        return unitsName;
    }

    public void setUnitsName(String unitsName) {
        this.unitsName = unitsName;
    }

    public String getPatBloodGroupCode() {
        return patBloodGroupCode;
    }

    public void setPatBloodGroupCode(String patBloodGroupCode) {
        this.patBloodGroupCode = patBloodGroupCode;
    }

    public String getRhCode() {
        return rhCode;
    }

    public void setRhCode(String rhCode) {
        this.rhCode = rhCode;
    }

    public List<BloodInpDetail> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<BloodInpDetail> detailList) {
        this.detailList = detailList;
    }

    public String getInpNo() {
        return inpNo;
    }

    public void setInpNo(String inpNo) {
        this.inpNo = inpNo;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getStopDate() {
        return stopDate;
    }

    public void setStopDate(Date stopDate) {
        this.stopDate = stopDate;
    }
}